home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 5: The Fifth Dimension
/
17 Bit - The Fifth Dimension (1995)(17 Bit Software)[!].iso
/
files
/
3620.dms
/
3620.adf
/
Rexx
/
PrintDir.filer
< prev
next >
Wrap
Text File
|
1993-11-27
|
1KB
|
80 lines
/*
$VER: PrintDir.filer 2.0 (22.11.93)
Author:
Matthias Scheler (tron@lyssa.pb.owl.de)
Function:
Opens a string requester, asks for a output file and writes a listing of
the selected directory listview to the output file.
Call:
PrintDir
Example for "Filer.RC":
BUTTON ...,...,"Print Dir","PrintDir"
*/
ADDRESS 'FilerRexx'
OPTIONS RESULTS
GETSOURCEPATH
IF RESULT="RESULT" THEN EXIT 5
SourceDir=RESULT
LOCKFILER
IF RESULT="RESULT" THEN EXIT 5
Key=Result
PANEL OFF
'STATUS Print directory'
'SETSTRING PRT:'
GETSTRING 'Choose file, or printer:'
IF RESULT="RESULT" THEN
DO
PANEL ON
UNLOCKFILER Key
EXIT 5
END
TargetName=RESULT
IF OPEN('Prt',TargetName,'WRITE')=0 THEN
DO
PANEL ON
UNLOCKFILER Key
ALERTBOX "Couldn't open output file !"
EXIT 5
END
'STATUS Printing directory "'||SourceDir||'" to "'||TargetName||'" ...'
CALL WRITELN('Prt','Directory "'||SourceDir||'":')
GETNUMENTRIES
Num=RESULT
DO Index=1 TO Num
GETNAME Index
Name=RESULT
GETINFO Index
Info=RESULT
IF UPPER(LEFT(Name,1))='F' THEN Line=LEFT(SUBSTR(Name,2)||' ',31)
ELSE Line=X2C(1B)||'[1m'||LEFT(SUBSTR(Name,2)||' ',31)||X2C(1B)||'[0m'
CALL WRITELN('Prt',Line||Info)
END
CALL WRITECH('Prt',X2C(C)||X2C(1B)||'[0m')
CALL CLOSE('Prt')
'HISTORY Printed directory "'||SourceDir||'" to "'||TargetName||'".'
PANEL ON
UNLOCKFILER Key